package cz.muni.fi.hauntedhouses;

import java.util.List;
import javax.ejb.EJB;
import javax.ejb.Local;
import javax.ejb.Stateless;
import javax.ejb.TransactionAttribute;
import javax.ejb.TransactionAttributeType;


/**
 *
 * @author Martin Vala, 359917
 */

@Stateless
@Local(value=HumanServiceLocal.class)
@TransactionAttribute(TransactionAttributeType.REQUIRED)
public class HumanService implements HumanServiceLocal {
    
    @EJB
    private HumanDAOLocal humanDao;
    
    
    @Override
    public void setHumanDAO(HumanDAOLocal humanDao) {
        this.humanDao = humanDao;
    }

    @Override
    public void create(HumanTO human) {
        
            humanDao.create(human);
        
    }

    @Override
    public List<HumanTO> findAll() {
        
            return humanDao.findAll();
        
    }

    @Override
    public List<HumanTO> findByGender(Gender gender) {
        
            return humanDao.findByGender(gender);
        
    }


    @Override
    public List<HumanTO> findByName(String name) {
        
            return humanDao.findByName(name);
        
    }

    @Override
    public List<HumanTO> findByResistence(int resistance) {
        
            return humanDao.findByResistence(resistance);
        
    }

    @Override
    public List<HumanTO> findByWorstFear(Fear worstFear) {
        
            return humanDao.findByWorstFear(worstFear);
        
    }

    @Override
    public HumanTO get(Long id) {
        
            return humanDao.get(id);
        
    }

    @Override
    public void remove(HumanTO human) {
        
            humanDao.remove(human);
        
    }

    @Override
    public void update(HumanTO human) {
        
            humanDao.update(human);
        
    }

}